home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
hacklist
/
94-04.Z
/
94-04
/
000010_rcq@mailserv-D.ftp.com_Sat Apr 9 07:28:25 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-04-30
|
3KB
Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA01579; Sat, 9 Apr 1994 11:31:45 -0400
Received: from ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:30 -0400
Received: from mailserv-D.ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:30 -0400
Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
id AA19987; Sat, 9 Apr 94 11:28:25 EDT
Date: Sat, 9 Apr 94 11:28:25 EDT
Message-Id: <9404091528.AA19987@mailserv-D.ftp.com>
To: winsock-hackers@sunsite.unc.edu
Subject: closesocket()/WSACleanup() question
From: rcq@ftp.com (Bob Quinn)
Reply-To: rcq@ftp.com
Cc: SawatH@msmailhq.netimage.com
Sender: rcq@mailserv-D.ftp.com
Repository: mailserv-D.ftp.com, [message accepted at Sat Apr 9 11:28:10 1994]
Originating-Client: hurricane.ftp.com
Content-Length: 2573
One of our customers recently brought a statement in the documen-
tation for WSACleanup() to my attention. I am amazed that the
section he quoted made it into the specification at all, let alone
the fact it's never been questioned since. Here is the customer's
message text (forwarded with his permission):
> I see this as a bug in the implementation. There shouldn't
> be any need to wait for the TCP close to complete before the
> call to WSACleanup(). Winsock spec 1.1 said
>
> "Any open SOCK_STREAM sockets that are connected when
> WSACleanup() is called are reset; sockets which have been closed
> with closesocket() but which still have pending data to be sent
> are not affected--the pending data is still sent."
>
> As you see, it explicitly said that in the last statement. This
> is also comfirm by the same behavior in other TCP/IP vendors such
> as Lan Workplace, BW, and NetManage.
This requirement is inappropriate for a few reasons:
- It's not possible to have a DLL that complies with this
requirement, unless it has a seperate process that exists
independently of the DLL (so it survives the DLL, after a
process has called WSACleanup() and Windows has called WEP()
and unloaded the DLL from memory). Hence, the specification
is making an unreasonable architectural requirement.
- Since a call to WSACleanup() means an application has severed
it's communication with the WinSock DLL and stack, there is
no way for the WinSock to subsequently notify the application
in the event of a failure. Networks fail sometimes. Computers
do too. Since the network or remote computer can fail after
the application calls WSACleanup(), there is no way a WinSock
DLL or stack can absolutely guarantee data delivery or a
graceful close. So, a DLL cannot be faulted if it resets the
connection when an application calls WSACleanup(), even if
closesocket() was called before. The application wouldn't
know the difference either way.
My take on it is that if an application really cares about its
data and/or having a graceful close of the connection, then it
should wait until the socket is closed before calling WSACleanup().
In other words, the onus should be on the application, not on the
WinSock DLL and stack. This is easily accomplished in an applica-
tion with FD_CLOSE notification, among other methods.
Comments?
--
Bob Quinn rcq@ftp.com
FTP Software, Inc. No. Andover, MA